#include<bits/stdc++.h>
using namespace std;
#define N 200020
int a[N], n, k;
bool check(int x){
    int cnt = 0;
    for(int i = 1; i <= n; i++){
        cnt += (a[i] / x);
        if(a[i] % x == 0) --cnt;
    }
    if(cnt <= k) return true;
    else return false;
}
int main(){
    cin>>n>>k;
    for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
    int l = 1, r = 1000000000, ans = 0;
    while(l <= r){
        int mid = (l + r) >> 1;
        // cout<<mid<<endl;
        if(check(mid)){
            ans = mid; r = mid - 1;
        }
        else l = mid + 1;
    }
    cout<<ans<<endl;
    return 0;
}